﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;

namespace WebGridExDemo.Models
{
    public class IndexViewModel
    {
        /// <summary>
        /// Name is used as the caption of the grid; Description is used as the summary attribute of the table tag
        /// </summary>
        [Display(Name = "Contact List", Description = "List of all active contacts of my company")]
        public IEnumerable<ContactViewModel> Contacts { get; set; }

        public int ContactCount
        {
            get { return this.Contacts.Count(); }
        }
    }
}